<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>QxOrm: C:/Dvlp/_Perso/QxOrm/include/QxDao/QxSqlDatabase.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="logo_qxorm.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">QxOrm
   &#160;<span id="projectnumber">1.4.3</span>
   </div>
   <div id="projectbrief">C++ Object Relational Mapping library</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_qx_sql_database_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">QxSqlDatabase.h</div>  </div>
</div>
<div class="contents">
<a href="_qx_sql_database_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/****************************************************************************</span>
<a name="l00002"></a>00002 <span class="comment">**</span>
<a name="l00003"></a>00003 <span class="comment">** http://www.qxorm.com/</span>
<a name="l00004"></a>00004 <span class="comment">** Copyright (C) 2013 Lionel Marty (contact@qxorm.com)</span>
<a name="l00005"></a>00005 <span class="comment">**</span>
<a name="l00006"></a>00006 <span class="comment">** This file is part of the QxOrm library</span>
<a name="l00007"></a>00007 <span class="comment">**</span>
<a name="l00008"></a>00008 <span class="comment">** This software is provided &#39;as-is&#39;, without any express or implied</span>
<a name="l00009"></a>00009 <span class="comment">** warranty. In no event will the authors be held liable for any</span>
<a name="l00010"></a>00010 <span class="comment">** damages arising from the use of this software</span>
<a name="l00011"></a>00011 <span class="comment">**</span>
<a name="l00012"></a>00012 <span class="comment">** Commercial Usage</span>
<a name="l00013"></a>00013 <span class="comment">** Licensees holding valid commercial QxOrm licenses may use this file in</span>
<a name="l00014"></a>00014 <span class="comment">** accordance with the commercial license agreement provided with the</span>
<a name="l00015"></a>00015 <span class="comment">** Software or, alternatively, in accordance with the terms contained in</span>
<a name="l00016"></a>00016 <span class="comment">** a written agreement between you and Lionel Marty</span>
<a name="l00017"></a>00017 <span class="comment">**</span>
<a name="l00018"></a>00018 <span class="comment">** GNU General Public License Usage</span>
<a name="l00019"></a>00019 <span class="comment">** Alternatively, this file may be used under the terms of the GNU</span>
<a name="l00020"></a>00020 <span class="comment">** General Public License version 3.0 as published by the Free Software</span>
<a name="l00021"></a>00021 <span class="comment">** Foundation and appearing in the file &#39;license.gpl3.txt&#39; included in the</span>
<a name="l00022"></a>00022 <span class="comment">** packaging of this file. Please review the following information to</span>
<a name="l00023"></a>00023 <span class="comment">** ensure the GNU General Public License version 3.0 requirements will be</span>
<a name="l00024"></a>00024 <span class="comment">** met : http://www.gnu.org/copyleft/gpl.html</span>
<a name="l00025"></a>00025 <span class="comment">**</span>
<a name="l00026"></a>00026 <span class="comment">** If you are unsure which license is appropriate for your use, or</span>
<a name="l00027"></a>00027 <span class="comment">** if you have questions regarding the use of this file, please contact :</span>
<a name="l00028"></a>00028 <span class="comment">** contact@qxorm.com</span>
<a name="l00029"></a>00029 <span class="comment">**</span>
<a name="l00030"></a>00030 <span class="comment">****************************************************************************/</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 <span class="preprocessor">#ifndef _QX_SQL_DATABASE_H_</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#define _QX_SQL_DATABASE_H_</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span>
<a name="l00035"></a>00035 <span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#pragma once</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &lt;QtCore/qhash.h&gt;</span>
<a name="l00047"></a>00047 <span class="preprocessor">#include &lt;QtCore/qmutex.h&gt;</span>
<a name="l00048"></a>00048 <span class="preprocessor">#include &lt;QtCore/qthread.h&gt;</span>
<a name="l00049"></a>00049 <span class="preprocessor">#include &lt;QtCore/quuid.h&gt;</span>
<a name="l00050"></a>00050 
<a name="l00051"></a>00051 <span class="preprocessor">#include &lt;QtSql/qsqldatabase.h&gt;</span>
<a name="l00052"></a>00052 <span class="preprocessor">#include &lt;QtSql/qsqlquery.h&gt;</span>
<a name="l00053"></a>00053 <span class="preprocessor">#include &lt;QtSql/qsqlerror.h&gt;</span>
<a name="l00054"></a>00054 
<a name="l00055"></a>00055 <span class="preprocessor">#include &lt;<a class="code" href="_qx_singleton_8h.html" title="Concrete class to define a thread-safe singleton of QxOrm library.">QxSingleton/QxSingleton.h</a>&gt;</span>
<a name="l00056"></a>00056 
<a name="l00057"></a>00057 <span class="preprocessor">#include &lt;<a class="code" href="_ix_sql_generator_8h.html" title="Common interface for all SQL generators to build SQL query specific for each database.">QxDao/QxSqlGenerator/IxSqlGenerator.h</a>&gt;</span>
<a name="l00058"></a>00058 
<a name="l00059"></a><a class="code" href="_qx_sql_database_8h.html#aaa6110705c3cd6cf64c510dd939f927c">00059</a> <span class="preprocessor">#define QX_CONSTRUCT_QX_SQL_DATABASE() \</span>
<a name="l00060"></a>00060 <span class="preprocessor">m_iPort(-1), m_bTraceSqlQuery(true), m_bTraceSqlRecord(false), \</span>
<a name="l00061"></a>00061 <span class="preprocessor">m_bTraceSqlBoundValues(false), m_bTraceSqlBoundValuesOnError(true), \</span>
<a name="l00062"></a>00062 <span class="preprocessor">m_ePlaceHolderStyle(ph_style_2_point_name), m_bSessionThrowable(false), \</span>
<a name="l00063"></a>00063 <span class="preprocessor">m_bSessionAutoTransaction(true), m_bValidatorThrowable(false), \</span>
<a name="l00064"></a>00064 <span class="preprocessor">m_bAutoReplaceSqlAliasIntoQuery(true), m_bVerifyOffsetRelation(false), \</span>
<a name="l00065"></a>00065 <span class="preprocessor">m_bAddAutoIncrementIdToUpdateQuery(true), m_bForceParentIdToAllChildren(false)</span>
<a name="l00066"></a>00066 <span class="preprocessor"></span>
<a name="l00067"></a>00067 <span class="keyword">namespace </span>qx {
<a name="l00068"></a>00068 
<a name="l00073"></a><a class="code" href="classqx_1_1_qx_sql_database.html">00073</a> <span class="keyword">class </span><a class="code" href="_qx_macro_8h.html#aa569abe24f343fdc4ad5e12e156ba8a2">QX_DLL_EXPORT</a> <a class="code" href="classqx_1_1_qx_sql_database.html" title="qx::QxSqlDatabase : define all parameters to connect to database and retrieve a valid connection by t...">QxSqlDatabase</a> : <span class="keyword">public</span> <a class="code" href="classqx_1_1_qx_singleton.html" title="qx::QxSingleton&lt;T&gt; : concrete class to define a thread-safe singleton of type T">QxSingleton</a>&lt;QxSqlDatabase&gt;
<a name="l00074"></a>00074 {
<a name="l00075"></a>00075 
<a name="l00076"></a><a class="code" href="classqx_1_1_qx_sql_database.html#ad0be8cf51f13f0c1e21d8cb72753b468">00076</a>    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classqx_1_1_qx_singleton.html" title="qx::QxSingleton&lt;T&gt; : concrete class to define a thread-safe singleton of type T">QxSingleton</a>&lt;<a class="code" href="classqx_1_1_qx_sql_database.html" title="qx::QxSqlDatabase : define all parameters to connect to database and retrieve a valid connection by t...">QxSqlDatabase</a>&gt;;
<a name="l00077"></a>00077 
<a name="l00078"></a>00078 <span class="keyword">public</span>:
<a name="l00079"></a>00079 
<a name="l00080"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a48b29d3658b6ef8d32af8c27a240892da3c0e899fe5e2f4f06e46de1831695490">00080</a>    <span class="keyword">enum</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a48b29d3658b6ef8d32af8c27a240892d">ph_style</a> { <a class="code" href="classqx_1_1_qx_sql_database.html#a48b29d3658b6ef8d32af8c27a240892da3c0e899fe5e2f4f06e46de1831695490">ph_style_question_mark</a>, ph_style_2_point_name, ph_style_at_name };
<a name="l00081"></a>00081 
<a name="l00082"></a>00082 <span class="keyword">private</span>:
<a name="l00083"></a>00083 
<a name="l00084"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a29ac4d4efadd76fcc528fffb27663bca">00084</a>    QHash&lt;Qt::HANDLE, QString&gt; <a class="code" href="classqx_1_1_qx_sql_database.html#a29ac4d4efadd76fcc528fffb27663bca" title="Collection of databases connexions by thread id.">m_lstDbByThread</a>;              
<a name="l00085"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a59db8191c59f8dd34e0e4dbce223cec4">00085</a>    QMutex <a class="code" href="classqx_1_1_qx_sql_database.html#a59db8191c59f8dd34e0e4dbce223cec4" title="Mutex =&gt; &#39;QxSqlDatabase&#39; is thread-safe.">m_oDbMutex</a>;                                       
<a name="l00086"></a><a class="code" href="classqx_1_1_qx_sql_database.html#af3402fe35d9791c095d8dc6b5e23a546">00086</a>    QString <a class="code" href="classqx_1_1_qx_sql_database.html#af3402fe35d9791c095d8dc6b5e23a546" title="Driver name to connect to database.">m_sDriverName</a>;                                   
<a name="l00087"></a><a class="code" href="classqx_1_1_qx_sql_database.html#ad65e4c26b41dc240a1fc1c7e9a742b0e">00087</a>    QString <a class="code" href="classqx_1_1_qx_sql_database.html#ad65e4c26b41dc240a1fc1c7e9a742b0e" title="Connect options to database.">m_sConnectOptions</a>;                               
<a name="l00088"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a94af29b37b1dd9e89b29063571ac57ba">00088</a>    QString <a class="code" href="classqx_1_1_qx_sql_database.html#a94af29b37b1dd9e89b29063571ac57ba" title="Database name.">m_sDatabaseName</a>;                                 
<a name="l00089"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a81492a1cf62d39ea39de55958964cc0e">00089</a>    QString <a class="code" href="classqx_1_1_qx_sql_database.html#a81492a1cf62d39ea39de55958964cc0e" title="Connection&#39;s user name.">m_sUserName</a>;                                     
<a name="l00090"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a20faeccb6ed13e01004d47b76ae3e60e">00090</a>    QString <a class="code" href="classqx_1_1_qx_sql_database.html#a20faeccb6ed13e01004d47b76ae3e60e" title="Connection&#39;s password.">m_sPassword</a>;                                     
<a name="l00091"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a57e46330765206b8663b033bbf726605">00091</a>    QString <a class="code" href="classqx_1_1_qx_sql_database.html#a57e46330765206b8663b033bbf726605" title="Connection&#39;s host name.">m_sHostName</a>;                                     
<a name="l00092"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a21805f39caab74e9ca02dbf351b243d0">00092</a>    <span class="keywordtype">int</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a21805f39caab74e9ca02dbf351b243d0" title="Connection&#39;s port number.">m_iPort</a>;                                             
<a name="l00093"></a><a class="code" href="classqx_1_1_qx_sql_database.html#afc29193001ebd11d1f480986a48da6b9">00093</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#afc29193001ebd11d1f480986a48da6b9" title="Trace each sql query executed.">m_bTraceSqlQuery</a>;                                   
<a name="l00094"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a83687373b48a2348ee4dee001adeed30">00094</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a83687373b48a2348ee4dee001adeed30" title="Trace each sql record.">m_bTraceSqlRecord</a>;                                  
<a name="l00095"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a36c90b2dfedd8e6bd781e4df9dfc7f27">00095</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a36c90b2dfedd8e6bd781e4df9dfc7f27" title="Trace sql bound values.">m_bTraceSqlBoundValues</a>;                             
<a name="l00096"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a37ee9cf1e19d7f1bf370302213562a6e">00096</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a37ee9cf1e19d7f1bf370302213562a6e" title="Trace sql bound values (only when an error occurred)">m_bTraceSqlBoundValuesOnError</a>;                      
<a name="l00097"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a4e9fa10838c9d5b6d27908ee510e27a1">00097</a>    <a class="code" href="classqx_1_1_qx_sql_database.html#a48b29d3658b6ef8d32af8c27a240892d">ph_style</a> <a class="code" href="classqx_1_1_qx_sql_database.html#a4e9fa10838c9d5b6d27908ee510e27a1" title="Place holder style to build sql query.">m_ePlaceHolderStyle</a>;                            
<a name="l00098"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a98b647ccdb10d51856e32f341dcf8289">00098</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a98b647ccdb10d51856e32f341dcf8289" title="An exception of type qx::dao::sql_error is thrown when a SQL error is appended to qx::QxSession objec...">m_bSessionThrowable</a>;                                
<a name="l00099"></a><a class="code" href="classqx_1_1_qx_sql_database.html#aa95a9340c83bd47b99c5b5cbb8906e83">00099</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#aa95a9340c83bd47b99c5b5cbb8906e83" title="A transaction is automatically beginned when a qx::QxSession object is instantiated.">m_bSessionAutoTransaction</a>;                          
<a name="l00100"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a323163ead2f00325a8ee562deb09925e">00100</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a323163ead2f00325a8ee562deb09925e" title="An exception of type qx::validator_error is thrown when invalid values are detected inserting or upda...">m_bValidatorThrowable</a>;                              
<a name="l00101"></a><a class="code" href="classqx_1_1_qx_sql_database.html#aed8e903b94cf73543551ac334322966d">00101</a>    <a class="code" href="namespaceqx_1_1dao_1_1detail.html#a388ca768bdd2e8785ce5584c5b11f5e6">qx::dao::detail::IxSqlGenerator_ptr</a> <a class="code" href="classqx_1_1_qx_sql_database.html#aed8e903b94cf73543551ac334322966d" title="SQL generator to build SQL query specific for each database.">m_pSqlGenerator</a>;     
<a name="l00102"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a8795af386b295443561865fb608aacbc">00102</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a8795af386b295443561865fb608aacbc" title="Replace all sql alias into sql query automatically.">m_bAutoReplaceSqlAliasIntoQuery</a>;                    
<a name="l00103"></a><a class="code" href="classqx_1_1_qx_sql_database.html#acc792061132d3d53c03dd8c1c4c42c2e">00103</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#acc792061132d3d53c03dd8c1c4c42c2e" title="Only for debug purpose : assert if invalid offset detected fetching a relation.">m_bVerifyOffsetRelation</a>;                            
<a name="l00104"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a8924ce8a09010f4655c423e2b5f80a68">00104</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a8924ce8a09010f4655c423e2b5f80a68" title="For Microsoft SqlServer database compatibility : add or not auto-increment id to SQL update query...">m_bAddAutoIncrementIdToUpdateQuery</a>;                 
<a name="l00105"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a2aaa38be1f9baeadf92cfbe0ad11fce3">00105</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a2aaa38be1f9baeadf92cfbe0ad11fce3" title="Force parent id to all children (for 1-n relationship for example)">m_bForceParentIdToAllChildren</a>;                      
<a name="l00106"></a>00106 
<a name="l00107"></a>00107 <span class="keyword">private</span>:
<a name="l00108"></a>00108 
<a name="l00109"></a><a class="code" href="classqx_1_1_qx_sql_database.html#afe3197d646a15b5cc8252ba718d55624">00109</a>    <a class="code" href="classqx_1_1_qx_sql_database.html#afe3197d646a15b5cc8252ba718d55624">QxSqlDatabase</a>() : <a class="code" href="classqx_1_1_qx_singleton.html" title="qx::QxSingleton&lt;T&gt; : concrete class to define a thread-safe singleton of type T">QxSingleton</a>&lt;<a class="code" href="classqx_1_1_qx_sql_database.html" title="qx::QxSqlDatabase : define all parameters to connect to database and retrieve a valid connection by t...">QxSqlDatabase</a>&gt;(<span class="stringliteral">&quot;qx::QxSqlDatabase&quot;</span>), <a class="code" href="_qx_sql_database_8h.html#aaa6110705c3cd6cf64c510dd939f927c">QX_CONSTRUCT_QX_SQL_DATABASE</a>() { ; }
<a name="l00110"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a823bb814c0c1776e8eed54ec180f576b">00110</a>    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a823bb814c0c1776e8eed54ec180f576b">~QxSqlDatabase</a>() { ; }
<a name="l00111"></a>00111 
<a name="l00112"></a>00112 <span class="keyword">public</span>:
<a name="l00113"></a>00113 
<a name="l00114"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a1d62cf29388bfdf7c83cc8b620332aa9">00114</a>    QString <a class="code" href="classqx_1_1_qx_sql_database.html#a1d62cf29388bfdf7c83cc8b620332aa9">getDriverName</a>()<span class="keyword"> const                   </span>{ <span class="keywordflow">return</span> m_sDriverName; }
<a name="l00115"></a><a class="code" href="classqx_1_1_qx_sql_database.html#ab3d16105b46b3a842db4dc6bed7ad443">00115</a>    QString <a class="code" href="classqx_1_1_qx_sql_database.html#ab3d16105b46b3a842db4dc6bed7ad443">getConnectOptions</a>()<span class="keyword"> const               </span>{ <span class="keywordflow">return</span> m_sConnectOptions; }
<a name="l00116"></a><a class="code" href="classqx_1_1_qx_sql_database.html#afaf28a646d201fdf600081e0449d801e">00116</a>    QString <a class="code" href="classqx_1_1_qx_sql_database.html#afaf28a646d201fdf600081e0449d801e">getDatabaseName</a>()<span class="keyword"> const                 </span>{ <span class="keywordflow">return</span> m_sDatabaseName; }
<a name="l00117"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a916426d3b58dca3c8e39fe78d30f153c">00117</a>    QString <a class="code" href="classqx_1_1_qx_sql_database.html#a916426d3b58dca3c8e39fe78d30f153c">getUserName</a>()<span class="keyword"> const                     </span>{ <span class="keywordflow">return</span> m_sUserName; }
<a name="l00118"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a6b6f1906a0d3fde279f118eb3e1d130e">00118</a>    QString <a class="code" href="classqx_1_1_qx_sql_database.html#a6b6f1906a0d3fde279f118eb3e1d130e">getPassword</a>()<span class="keyword"> const                     </span>{ <span class="keywordflow">return</span> m_sPassword; }
<a name="l00119"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a2f8d7a4dae6bc305bafc8d3a525bf6fb">00119</a>    QString <a class="code" href="classqx_1_1_qx_sql_database.html#a2f8d7a4dae6bc305bafc8d3a525bf6fb">getHostName</a>()<span class="keyword"> const                     </span>{ <span class="keywordflow">return</span> m_sHostName; }
<a name="l00120"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a17efa9874ae1c5112af306887e7ecd3b">00120</a>    <span class="keywordtype">int</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a17efa9874ae1c5112af306887e7ecd3b">getPort</a>()<span class="keyword"> const                             </span>{ <span class="keywordflow">return</span> m_iPort; }
<a name="l00121"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a77fe21b2677f327d724841c04cae9916">00121</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a77fe21b2677f327d724841c04cae9916">getTraceSqlQuery</a>()<span class="keyword"> const                   </span>{ <span class="keywordflow">return</span> m_bTraceSqlQuery; }
<a name="l00122"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a4b404fda72b30145d38008e446ae4ec1">00122</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a4b404fda72b30145d38008e446ae4ec1">getTraceSqlRecord</a>()<span class="keyword"> const                  </span>{ <span class="keywordflow">return</span> m_bTraceSqlRecord; }
<a name="l00123"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a90bb033be2ed1af892c54d3b3a25068c">00123</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a90bb033be2ed1af892c54d3b3a25068c">getTraceSqlBoundValues</a>()<span class="keyword"> const             </span>{ <span class="keywordflow">return</span> m_bTraceSqlBoundValues; }
<a name="l00124"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a1b9ad630ccf162b96d7eda0c5a5c76ca">00124</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a1b9ad630ccf162b96d7eda0c5a5c76ca">getTraceSqlBoundValuesOnError</a>()<span class="keyword"> const      </span>{ <span class="keywordflow">return</span> m_bTraceSqlBoundValuesOnError; }
<a name="l00125"></a><a class="code" href="classqx_1_1_qx_sql_database.html#acf77c5cc92f2c8406f9c7472eb357452">00125</a>    <a class="code" href="classqx_1_1_qx_sql_database.html#a48b29d3658b6ef8d32af8c27a240892d">ph_style</a> <a class="code" href="classqx_1_1_qx_sql_database.html#acf77c5cc92f2c8406f9c7472eb357452">getSqlPlaceHolderStyle</a>()<span class="keyword"> const         </span>{ <span class="keywordflow">return</span> m_ePlaceHolderStyle; }
<a name="l00126"></a><a class="code" href="classqx_1_1_qx_sql_database.html#af735a70c876d4ddfefa85b63b077a0da">00126</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#af735a70c876d4ddfefa85b63b077a0da">getSessionThrowable</a>()<span class="keyword"> const                </span>{ <span class="keywordflow">return</span> m_bSessionThrowable; }
<a name="l00127"></a><a class="code" href="classqx_1_1_qx_sql_database.html#ac22345494520b6a388b0cfe89e691061">00127</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#ac22345494520b6a388b0cfe89e691061">getSessionAutoTransaction</a>()<span class="keyword"> const          </span>{ <span class="keywordflow">return</span> m_bSessionAutoTransaction; }
<a name="l00128"></a><a class="code" href="classqx_1_1_qx_sql_database.html#ae4e4840ce1dc9394ebefdf7b742fb4cd">00128</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#ae4e4840ce1dc9394ebefdf7b742fb4cd">getValidatorThrowable</a>()<span class="keyword"> const              </span>{ <span class="keywordflow">return</span> m_bValidatorThrowable; }
<a name="l00129"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a62065b840b314dc4a399691b1e83a5c0">00129</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a62065b840b314dc4a399691b1e83a5c0">getAutoReplaceSqlAliasIntoQuery</a>()<span class="keyword"> const    </span>{ <span class="keywordflow">return</span> m_bAutoReplaceSqlAliasIntoQuery; }
<a name="l00130"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a5ff3870680ae44bda9e9f05013009d4a">00130</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a5ff3870680ae44bda9e9f05013009d4a">getVerifyOffsetRelation</a>()<span class="keyword"> const            </span>{ <span class="keywordflow">return</span> m_bVerifyOffsetRelation; }
<a name="l00131"></a><a class="code" href="classqx_1_1_qx_sql_database.html#afc87acc478318a5afe10544c4f835a31">00131</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#afc87acc478318a5afe10544c4f835a31">getAddAutoIncrementIdToUpdateQuery</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_bAddAutoIncrementIdToUpdateQuery; }
<a name="l00132"></a><a class="code" href="classqx_1_1_qx_sql_database.html#ae77753f735f52ce03a1e771f37cf504b">00132</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#ae77753f735f52ce03a1e771f37cf504b">getForceParentIdToAllChildren</a>()<span class="keyword"> const      </span>{ <span class="keywordflow">return</span> m_bForceParentIdToAllChildren; }
<a name="l00133"></a>00133 
<a name="l00134"></a><a class="code" href="classqx_1_1_qx_sql_database.html#ae51bc10cb5766617b6e1311c35bdea9b">00134</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#ae51bc10cb5766617b6e1311c35bdea9b">setDriverName</a>(<span class="keyword">const</span> QString &amp; s)                          { m_sDriverName = s; getSqlGenerator(); }
<a name="l00135"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a311a73cba669113a4fd4142e3d443054">00135</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a311a73cba669113a4fd4142e3d443054">setConnectOptions</a>(<span class="keyword">const</span> QString &amp; s)                      { m_sConnectOptions = s; }
<a name="l00136"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a60e135de4fde315a4a7b804bbcef3214">00136</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a60e135de4fde315a4a7b804bbcef3214">setDatabaseName</a>(<span class="keyword">const</span> QString &amp; s)                        { m_sDatabaseName = s; }
<a name="l00137"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a72aa830dd872023bf90c8e32d7c5124f">00137</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a72aa830dd872023bf90c8e32d7c5124f">setUserName</a>(<span class="keyword">const</span> QString &amp; s)                            { m_sUserName = s; }
<a name="l00138"></a><a class="code" href="classqx_1_1_qx_sql_database.html#af48b9da3239f364c3486813630b561be">00138</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#af48b9da3239f364c3486813630b561be">setPassword</a>(<span class="keyword">const</span> QString &amp; s)                            { m_sPassword = s; }
<a name="l00139"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a0ef7eab3ff72f1c2d80300b1bbff9885">00139</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a0ef7eab3ff72f1c2d80300b1bbff9885">setHostName</a>(<span class="keyword">const</span> QString &amp; s)                            { m_sHostName = s; }
<a name="l00140"></a><a class="code" href="classqx_1_1_qx_sql_database.html#acb6d1a46db155a30d22322450739b2ef">00140</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#acb6d1a46db155a30d22322450739b2ef">setPort</a>(<span class="keywordtype">int</span> i)                                            { m_iPort = i; }
<a name="l00141"></a><a class="code" href="classqx_1_1_qx_sql_database.html#aaa3b6844cc7517089b0c7c70040fbb6d">00141</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#aaa3b6844cc7517089b0c7c70040fbb6d">setTraceSqlQuery</a>(<span class="keywordtype">bool</span> b)                                  { m_bTraceSqlQuery = b; }
<a name="l00142"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a64c97af76f35c6c59587cc5c98a80a44">00142</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a64c97af76f35c6c59587cc5c98a80a44">setTraceSqlRecord</a>(<span class="keywordtype">bool</span> b)                                 { m_bTraceSqlRecord = b; }
<a name="l00143"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a5982d931141143f6aac01484df7b3165">00143</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a5982d931141143f6aac01484df7b3165">setTraceSqlBoundValues</a>(<span class="keywordtype">bool</span> b)                            { m_bTraceSqlBoundValues = b; }
<a name="l00144"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a97263133427e1398f87f5aba0a7e961f">00144</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a97263133427e1398f87f5aba0a7e961f">setTraceSqlBoundValuesOnError</a>(<span class="keywordtype">bool</span> b)                     { m_bTraceSqlBoundValuesOnError = b; }
<a name="l00145"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a866eb718c136cc059eafafd5d7abea8a">00145</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a866eb718c136cc059eafafd5d7abea8a">setSqlPlaceHolderStyle</a>(<a class="code" href="classqx_1_1_qx_sql_database.html#a48b29d3658b6ef8d32af8c27a240892d">ph_style</a> e)                        { m_ePlaceHolderStyle = e; }
<a name="l00146"></a><a class="code" href="classqx_1_1_qx_sql_database.html#af1a50b3555f94f12bd54e076b384fe6f">00146</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#af1a50b3555f94f12bd54e076b384fe6f">setSessionThrowable</a>(<span class="keywordtype">bool</span> b)                               { m_bSessionThrowable = b; }
<a name="l00147"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a2a79b1a0c53526fd81a04235006aa800">00147</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a2a79b1a0c53526fd81a04235006aa800">setSessionAutoTransaction</a>(<span class="keywordtype">bool</span> b)                         { m_bSessionAutoTransaction = b; }
<a name="l00148"></a><a class="code" href="classqx_1_1_qx_sql_database.html#ab47565200e8cff6a78a7466db418b2e4">00148</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#ab47565200e8cff6a78a7466db418b2e4">setValidatorThrowable</a>(<span class="keywordtype">bool</span> b)                             { m_bValidatorThrowable = b; }
<a name="l00149"></a><a class="code" href="classqx_1_1_qx_sql_database.html#aee2f0988038d2e37f2dd71996cb9bc91">00149</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#aee2f0988038d2e37f2dd71996cb9bc91">setSqlGenerator</a>(<a class="code" href="namespaceqx_1_1dao_1_1detail.html#a388ca768bdd2e8785ce5584c5b11f5e6">qx::dao::detail::IxSqlGenerator_ptr</a> p)    { m_pSqlGenerator = p; <span class="keywordflow">if</span> (p) { p-&gt;init(); } }
<a name="l00150"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a59dec65384f4c5c641f17cbb128465d4">00150</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a59dec65384f4c5c641f17cbb128465d4">setAutoReplaceSqlAliasIntoQuery</a>(<span class="keywordtype">bool</span> b)                   { m_bAutoReplaceSqlAliasIntoQuery = b; }
<a name="l00151"></a><a class="code" href="classqx_1_1_qx_sql_database.html#ab74e6e5d76c793b004f8c297d9195d85">00151</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#ab74e6e5d76c793b004f8c297d9195d85">setVerifyOffsetRelation</a>(<span class="keywordtype">bool</span> b)                           { m_bVerifyOffsetRelation = b; }
<a name="l00152"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a4d6d644fdadd7e284ec006afc6842d02">00152</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a4d6d644fdadd7e284ec006afc6842d02">setAddAutoIncrementIdToUpdateQuery</a>(<span class="keywordtype">bool</span> b)                { m_bAddAutoIncrementIdToUpdateQuery = b; }
<a name="l00153"></a><a class="code" href="classqx_1_1_qx_sql_database.html#aebe596f0ff966433242213f2a7226664">00153</a>    <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_qx_sql_database.html#aebe596f0ff966433242213f2a7226664">setForceParentIdToAllChildren</a>(<span class="keywordtype">bool</span> b)                     { m_bForceParentIdToAllChildren = b; }
<a name="l00154"></a>00154 
<a name="l00155"></a>00155    <span class="keyword">static</span> QSqlDatabase getDatabase();
<a name="l00156"></a>00156    <span class="keyword">static</span> QSqlDatabase getDatabase(QSqlError &amp; dbError);
<a name="l00157"></a>00157    <span class="keyword">static</span> QSqlDatabase getDatabaseCloned();
<a name="l00158"></a>00158    <span class="keyword">static</span> <span class="keywordtype">void</span> closeAllDatabases();
<a name="l00159"></a>00159    <span class="keyword">static</span> <span class="keywordtype">void</span> clearAllDatabases();
<a name="l00160"></a>00160 
<a name="l00161"></a>00161    <a class="code" href="classqx_1_1dao_1_1detail_1_1_ix_sql_generator.html" title="qx::dao::detail::IxSqlGenerator : common interface for all SQL generators to build SQL query specific...">qx::dao::detail::IxSqlGenerator</a> * getSqlGenerator();
<a name="l00162"></a>00162 
<a name="l00163"></a>00163 <span class="keyword">private</span>:
<a name="l00164"></a>00164 
<a name="l00165"></a>00165    QSqlDatabase getDatabaseByCurrThreadId(QSqlError &amp; dbError);
<a name="l00166"></a>00166    QSqlDatabase createDatabase(QSqlError &amp; dbError);
<a name="l00167"></a>00167 
<a name="l00168"></a>00168    <span class="keywordtype">void</span> displayLastError(<span class="keyword">const</span> QSqlDatabase &amp; db, <span class="keyword">const</span> QString &amp; sDesc) <span class="keyword">const</span>;
<a name="l00169"></a>00169    QString formatLastError(<span class="keyword">const</span> QSqlDatabase &amp; db) <span class="keyword">const</span>;
<a name="l00170"></a>00170 
<a name="l00171"></a><a class="code" href="classqx_1_1_qx_sql_database.html#a01c48d6390a2e71442990bb0be8bf12a">00171</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_qx_sql_database.html#a01c48d6390a2e71442990bb0be8bf12a">isValid</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (! m_sDriverName.isEmpty() &amp;&amp; ! m_sDatabaseName.isEmpty()); }
<a name="l00172"></a>00172 
<a name="l00173"></a>00173 };
<a name="l00174"></a>00174 
<a name="l00175"></a>00175 } <span class="comment">// namespace qx</span>
<a name="l00176"></a>00176 
<a name="l00177"></a>00177 <a class="code" href="_qx_macro_8h.html#ad82efc1fae0529dca4a20067c88a9524">QX_DLL_EXPORT_QX_SINGLETON_HPP</a>(<a class="code" href="classqx_1_1_qx_sql_database.html" title="qx::QxSqlDatabase : define all parameters to connect to database and retrieve a valid connection by t...">qx::QxSqlDatabase</a>)
<a name="l00178"></a>00178 
<a name="l00179"></a>00179 <span class="preprocessor">#endif // _QX_SQL_DATABASE_H_</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_qx_sql_database_8h.html">QxSqlDatabase.h</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">Generated on Sun Dec 11 2016 13:41:03 for QxOrm by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
